<script setup>
const posts = [
  {
    post_id: 1,
    post_title: "testtest",
    user_id: 1,
    username: "czy",
    create_time: "2001-02-02 00:00:00"
  },
  {
    post_id: 1,
    post_title: "testtest",
    user_id: 1,
    username: "czy",
    create_time: "2001-02-02 00:00:00"
  },
  {
    post_id: 1,
    post_title: "testtest",
    user_id: 1,
    username: "czy",
    create_time: "2001-02-02 00:00:00"
  },
  {
    post_id: 1,
    post_title: "testtest",
    user_id: 1,
    username: "czy",
    create_time: "2001-02-02 00:00:00"
  }
]
const imgUrl = "https://re.bluepoch.com/home/img/character/6.png";
</script>

<template>
  <div>
    <h1>评论管理</h1>
  </div>
  <!--  图片懒加载-->
  <div style="display:flex;flex-direction: column;justify-content:space-around;align-items:center">
    <div v-for="item in 6">
      <img v-img-lazy="imgUrl" src="@/assets/imgs/login_avator.png" style="width: 250px" alt="155151"/>
    </div>
  </div>

  <!--  发布话题管理-->
  <div class="comment-content">
    <el-table :data="posts"
              border
              style="width: 100%;"
              height="100%"
              @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"/>
      <el-table-column property="post_id" label="发布者id" min-width="50" align="center"/>
      <el-table-column property="post_title" label="话题标题" min-width="100" align="center"/>
      <el-table-column property="user_id" label="发布者id" min-width="50" align="center"/>
      <el-table-column property="username" label="发布者姓名" min-width="80" align="center"/>
      <el-table-column label="发布日期" width="300" align="center">
        <template #default="scope">{{ scope.row.create_time }}</template>
      </el-table-column>
      <el-table-column align="center" fixed="right" label="操作" min-width="120">
        <template #default="scope">
          <el-button type="primary" size="default" @click="handleClick(scope.row)">进入话题</el-button>
          <el-button type="warning" size="default" @click="handleUpdateClick(scope.row)">查看</el-button>
          <el-button type="danger" size="default" @click="handleUpdateClick(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<style scoped>

</style>